package model;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import dao.GetCnn;

import entity.Binhluan;

public class BinhluanModel {
	public List<Binhluan> listbinhluan(String strSearch) throws SQLException
	{
		List<Binhluan> listbl = new ArrayList<Binhluan>();
		Connection cnn = GetCnn.getCnn();
		Statement stat = cnn.createStatement();
		ResultSet rs = stat.executeQuery(strSearch);
		while(rs.next())
		{
			Binhluan entity = new Binhluan();
			entity.setMasp(rs.getString("MASP"));
			entity.setTennguoibl(rs.getString("TENNGUOIBL"));
			entity.setEmail(rs.getString("EMAIL"));
			entity.setNoidung(rs.getString("NOIDUNG"));
			entity.setNgaybl(rs.getString("NGAYBL"));
			listbl.add(entity);
		}
		return listbl;
	}

}
